<template>
    <div class="wrap">
        <div class="content">
            <div id="food">
                <div></div>
                <div></div>
                <div></div>
                <div></div>
            </div>
            <div id="snake">
                <div></div>
                <div></div>
                <div></div>
                <div></div>
            </div>
        </div>
        <div class="scoll">
            <div class="score">SCORE: <span id="score">0</span></div>
            <div class="level">LEVEL: <span id="level">1</span></div>
        </div>
    </div>
</template>
<script lang="ts">
import { defineComponent } from 'vue';
import Food from '@/types/food';
import ScorePanel from '@/types/scorePanel';

export default defineComponent({
  mounted() {
    const food: Food = new Food();
    food.change();
    const scorePanel: ScorePanel = new ScorePanel();
    for (let i = 0; i < 101; i += 1) {
      scorePanel.addScore();
    }
    console.log(food.X);
  },
  setup() {
    return {};
  },
});
</script>
<style lang="less" scoped>
@bg-color: #b7d4a8;
div {
    flex-direction: column;
    display: flex;
    box-sizing: border-box;
}
.wrap {
    width: 360px;
    height: 420px;
    justify-content: space-between;
    margin: 100px auto;
    background-color: @bg-color;
    border: 10px solid #000;
    border-radius: 20px;
    .content {
        width: 304px;
        height: 304px;
        border: 2px solid #000;
        margin: 18px;
        position: relative;
    }
    .scoll{
        margin: 18px;
        flex-direction: row;
        justify-content: space-between;
        font-weight: bold;
        font-size: 20px;
        font-family: 'Courier New', Courier, monospace;
    }
    #food {
        width: 10px;
        height: 10px;
        justify-content: space-between;
        align-content: space-between;
        flex-direction: row;
        flex-wrap: wrap;
        position: absolute;
        left: 10px;
        top: 40px;
        &>div{
            width: 4px;
            height: 4px;
            border-radius: 1px;
            background-color: black;
            transform: rotate(45deg);
        }
    }
    #snake {
        &>div{
            width: 10px;
            height: 10px;
            background-color: black;
            border: 1px solid @bg-color;
            position: absolute;
        }
    }
}
</style>
